package demo4;

public class Test {
    public static void main(String[] args) {
        Object obj = new Dog("hh", 2);
        Object a = 10;
    }
    public static void swimming(ISwimmingable s){
        s.swim();
    }
    public static void running(IRunnabel i){
        i.run();
    }
    public static void flying(IFlyable s){
        s.fly();
    }
    public static void eatTest(Animal animal){
        animal.eat();
    }
    public static void main1(String[] args) {
        Fish fish = new Fish("小鱼", 1);
        Dog dog = new Dog("小狗", 2);
        Brid brid = new Brid("小鸟", 1);

        /*eatTest(fish);
        eatTest(dog);
        eatTest(brid);*/
        swimming(dog);
        Robit robit = new Robit();
        running(robit);
        Frog frog = new Frog("蛙", 2);
        frog.run();

    }
}
